package com.flying.invest.assets.service;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.common.util.Codes;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.model.ActionResult;
import com.flying.framework.model.QueryResult;
import com.flying.framework.service.AbstractService;
import com.flying.invest.assets.model.AssetsBlock;

@Service(value="AssetsBlockService", desc="资产板块")
public class AssetsBlockService extends AbstractService{
        
	@MethodInfo("新增")
	@DaoCreate(entity=AssetsBlock.ENTITY_NAME)
	public AssetsBlock create(
		
			@Param(value=AssetsBlock.NAME, required=true,	desc="名称") String name,
			@Param(value=AssetsBlock.CATEGORY, required=true,	desc="大类（0：股票；1：基金）") Integer category,
			@Param(value=AssetsBlock.PARENT_ID, required=false,	desc="上级板块") Long parent_id,
			@Param(value=AssetsBlock.REMARKS, required=false,	desc="说明") String remarks
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("修改")
	@DaoUpdate(entity=AssetsBlock.ENTITY_NAME)
	public ActionResult update(
		
			@Param(value=AssetsBlock.BLOCK_ID, required=true,	desc="板块ID") Long block_id,
			@Param(value=AssetsBlock.NAME, required=true,	desc="名称") String name,
			@Param(value=AssetsBlock.CATEGORY, required=true,	desc="大类（0：股票；1：基金）") Integer category,
			@Param(value=AssetsBlock.PARENT_ID, required=false,	desc="上级板块") Long parent_id,
			@Param(value=AssetsBlock.REMARKS, required=false,	desc="说明") String remarks
			
		) throws Exception {
		
		return null;
	}

	@MethodInfo("删除")
	@DaoRemove(entity=AssetsBlock.ENTITY_NAME)
	public ActionResult remove(
		
			@Param(value=AssetsBlock.BLOCK_ID, required=true,	desc="板块ID") Long block_id
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("搜索")
	@DaoQuery(entity=AssetsBlock.ENTITY_NAME, pageable=true, modelClass=AssetsBlock.class)
	public QueryResult<AssetsBlock> findAll(
			@Param(value=Codes.PAGE_NUM, 	required=false, desc="分页页号，默认0") int page,
			@Param(value=Codes.PAGE_SIZE, 	required=false, desc="分页大小，默认10") int rows) throws Exception {
		return null;
	}

	@MethodInfo("查询")
	@DaoQuery(entity=AssetsBlock.ENTITY_NAME, single=true, throwsNotFoundException=true )
	public AssetsBlock findById(
			@Param(value=AssetsBlock.BLOCK_ID, required=true,	desc="板块ID") Long block_id
		) {
		return null;
	}

}